import request from '@/utils/request'

// 封装查询企业的部门列表
export function getDepartmentsAPI () {
  return request({
    url: '/company/department'
  })
}

// 封装根据id删除部门的API
export function delDepartment (id) {
  return request({
    url: '/company/department/' + id,
    method: 'delete'
  })
}

// 封装新增部门的API
export function addDepartmentAPI (data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}

// 封装根据id修改部门详情的API
export function editDepartmentAPI (id) {
  return request({
    url: `/company/department/${id}`
  })
}
// 根据ID修改部门详情
export function modifyDepartmentAPI (data) {
  return request({
    url: '/company/department/' + data.id,
    method: 'put',
    data
  })
}

